BGSOUND | NN n/a IE 4 DOM n/a | ||
A BGSOUND element defines a sound file that is to play in the background while the user visits the page. Set properties to control the volume and how many times the sound track plays even after the sound file has loaded. A few properties, such as innerHTML and innerText, are exposed in the Windows version, but they don't apply to an element that does not have an end tag. | |||
HTML Equivalent<BGSOUND> | |||
Object Model Reference
|
balance | NN n/a IE 4 DOM n/a | ||
Read-only | |||
How the audio is divided between the left and right speakers. Once this attribute value is set in the element, its value cannot be changed by script control. | |||
Examplevar currBal = document.all.tags("bgsound")[0].balance | |||
Value A signed integer between -10,000 and +10,000. A value of is equally balanced on both sides. A negative value means the left side is dominant; a positive value means the right side is dominant. | |||
|
loop | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
The number of times the sound plays. Assigning a value of -1 means the sound plays continuously until the page is unloaded. | |||
Exampledocument.all.mySound.loop = 3 | |||
Value Integer. | |||
|
src | NN n/a IE 4 DOM n/a | ||
Read/Write | |||
URL of the sound file to be played. Change tunes by assigning a new URL to the property. | |||
Exampledocument.all.tune.src = "sounds/blues.aif" | |||
Value Complete or relative URL as a string. | |||
|
volume | NN n/a IE 4 DOM n/a | ||
Read-only | |||
How loud the background sound plays relative to the maximum sound
output level as adjusted by user preferences in the client computer.
Maximum volume--a setting of zero--is only as loud as the
user has set the | |||
Examplevar currVolume = document.all.themeSong.volume | |||
Value Integer. | |||
|